package com.fqgj.xjd.user.client.enums;

import java.util.ArrayList;
import java.util.List;

public enum UsagesEnum {
    CONSUME(0, "Daily Consumption"),
    EDUCATION(1, "Education"),
    MEDICAL_TREATMENT(2, "Medical Treatment"),
    TRIP(3, "Trip"),
    HOUSE_RENOVATION(4, "House Renovation")
    ;

    private Integer type;

    private String desc;

    UsagesEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public UsagesEnum setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public UsagesEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static UsagesEnum getEnumByType(Integer type) {
        UsagesEnum userTagTypeEnum = null;
        for (UsagesEnum u : UsagesEnum.values()) {
            if (u.getType().equals(type)) {
                userTagTypeEnum = u;
            }
        }

        return userTagTypeEnum;
    }

    public static List<UsagesEnum> getAuditEnums(){
        List<UsagesEnum> userTagTypeEnumList = new ArrayList<>();
        for (UsagesEnum userTagTypeEnum : UsagesEnum.values()){
            userTagTypeEnumList.add(userTagTypeEnum);
        }
        return userTagTypeEnumList;
    }

}
